#include "widget.h"
#include "ui_widget.h"
#include <QIcon>
#include <QSize>
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPixmap pix(":/blue");
    QRect rect = this->geometry();
    ui->label->setGeometry(0,0,rect.width(),rect.height());
    ui->label->setPixmap(pix);
    ui->label->setScaledContents(true);

    ui->label_3->setAlignment(Qt::AlignTop | Qt::AlignLeft);
     ui->label_3->setWordWrap(true);
     ui->label_3->setText("这是⼀个很⻓的⽂本这是⼀个很⻓的⽂本这是⼀个很⻓的⽂本这是⼀个很⻓的⽂本这是⼀个很⻓的⽂本这是⼀个很⻓的⽂本");


    ui->label_2->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::resizeEvent(QResizeEvent *event)
{
    ui->label->setGeometry(0,0,event->size().width(),event->size().height());
    qDebug() << event->size();
}

